from aiogram_dialog import Dialog, Window
from aiogram_dialog.widgets.input import TextInput
from aiogram_dialog.widgets.kbd import Cancel

from src.presentation.tg_bot.dialogs.widgets import LocaleText
from src.presentation.tg_bot.states import AddAllowedIPSG

enter_ip_window = Window(
    LocaleText("enter-ip-address"),
    TextInput("ipaddressinp", str, on_success=add_ip_address),
    Cancel(LocaleText("back-btn")),
    state=AddAllowedIPSG.enter_ip_address,
)

add_allowed_ip_dialog = Dialog(enter_ip_window)
